package array.newcode;

/**
 * @author Dianzhi Han
 * @version 1.0
 * @description: TODO
 * @date 2022/9/27 15:51
 */
public class JZ5_ReplaceTheBlank {
    public String replaceSpace(StringBuffer str) {
        String string = str.toString();
        String[] array = string.split(" ",-1);
        String ret = "";
        for (int i = 0 ; i<array.length-1 ; i++) {
            ret += array[i] + "%20" ;
        }
        ret += array[array.length-1];
        return ret;
    }
}
